# Contributor: rubicon <rubicon@mailo.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=picat
pkgver=3.5.5
_pkgver="${pkgver//./}"
pkgrel=1
pkgdesc="Logic-based multi-paradigm programming language"
url="http://picat-lang.org/"
arch="all"
license="MPL-2.0"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::http://picat-lang.org/download/picat${_pkgver}_src.tar.gz
	fix-fileno-usage.patch
	"
builddir="$srcdir/Picat/emu"

build() {
	make -f Makefile.linux64
}

check() {
	./picat --version
}

package() {
	local extdir="$srcdir"/Picat

	install -Dvm755 picat -t "$pkgdir"/usr/bin/

	install -Dvm644 "$extdir"/lib/* \
		-t "$pkgdir"/usr/lib/$pkgname

	install -Dvm644 "$extdir"/README \
		"$extdir"/LICENSE "$extdir"/doc/* \
		-t "$pkgdir"/usr/share/doc/$pkgname

	mv -v "$extdir"/exs \
		"$pkgdir"/usr/share/doc/$pkgname/examples
}

sha512sums="
89b62dcab6f204cda3580af938994108de0b3ff7f4333a7330cb8ba157771ac1cfd4f9fc29a6fc3e4ecd58bbcb4e41b9dbcb283189dd794ba9d17bca019d6969  picat-3.5.5.tar.gz
82c43ff6625dccce2919c5e1b26eb4dc047d95ee9bc0a2cd5b42053f2b0a2dd54457c650d59c8eccdb4ce0e7500950e43b97a05f900c459267e4132eda691789  fix-fileno-usage.patch
"
